// Copyright 2014 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef PROTO_COMPILER_H_
#define PROTO_COMPILER_H_

#include <string>

// Wrapper around the C++ proto compiler implementation so that we can
// guarantee a stable and python-friendly interface to users.
// This is a pure interface to avoid having to make the internal imports
// visible to SWIG.
class ProtoCompiler {
 public:
  virtual ~ProtoCompiler();

  // Map a path in the compilers virtual import filesystem to a path on the
  // real filesystem.
  virtual void map_path(const std::string &virtual_path,
                        const std::string &disk_path) = 0;

  // Import the specified file, return it as a serialized file descriptor.
  // Returns an empty string if there were errors.
  virtual std::string parse(const std::string &filename) = 0;

  // Create a new instance.
  static ProtoCompiler *create();
};

#endif
